import request from '@/utils/request'
import upload from '@/utils/upload'

// 查询sku列表
export function skuList(query) {
	return request({
		url: '/system/app/sku/list',
		method: 'GET',
		params: query
	})
}


// 新增sku
export function addSku(data) {
	return request({
		url: '/system/app/sku/add' ,
		method: 'POST',
		data: data
	})
}
// 修改sku
export function updateSku(data) {
	return request({
		url: '/system/app/sku/update' ,
		method: 'POST',
		data: data
	})
}
// 删除sku
export function delSku(data) {
	return request({
		url: '/system/app/sku/del' ,
		method: 'POST',
		data: data
	})
}

// 增加库存
export function addSkuStock(data) {
	return request({
		url: '/system/app/sku/stock/add' ,
		method: 'POST',
		data: data
	})
}


//更新系列主图
export function updateSkuImg(data) {
	return request({
		url: '/system/app/sku/img/update',
		method: 'post',
		data: data
	})
}

// 图片上传
export function uploadImg(data) {
  return upload({
    url: '/system/profile/upload',
    name: data.name,
    filePath: data.filePath
  })
}
